/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-9-18 下午3:32 Created by dwzhang
 */
package com.jade.bss.weixin.api.protocol.xml;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import org.apache.commons.lang3.StringUtils;

/**
 * 通用的响应。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-9-18 下午3:32
 */
@XmlAccessorType (XmlAccessType.FIELD)
public class Response
        implements Serializable
{
    public static final String SUCCESS = "SUCCESS";
    public static final String FAIL = "FAIL";
    @XmlElement (name = "return_code")
    private String returnCode = SUCCESS;
    @XmlElement (name = "return_msg")
    private String returnMsg = "OK";
    @XmlElement (name = "sign")
    private String sign;
    @XmlElement (name = "result_code")
    private String resultCode = SUCCESS;
    @XmlElement (name = "err_code")
    private String errCode;
    @XmlElement (name = "err_code_des")
    private String errCodeDes;

    public String getReturnCode()
    {
        return returnCode;
    }

    public void setReturnCode(String returnCode)
    {
        this.returnCode = returnCode;
    }

    public String getReturnMsg()
    {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg)
    {
        this.returnMsg = returnMsg;
    }

    public String getSign()
    {
        return sign;
    }

    public void setSign(String sign)
    {
        this.sign = sign;
    }

    public String getResultCode()
    {
        return resultCode;
    }

    public void setResultCode(String resultCode)
    {
        this.resultCode = resultCode;
    }

    public String getErrCode()
    {
        return errCode;
    }

    public void setErrCode(String errCode)
    {
        this.errCode = errCode;
    }

    public String getErrCodeDes()
    {
        return errCodeDes;
    }

    public void setErrCodeDes(String errCodeDes)
    {
        this.errCodeDes = errCodeDes;
    }

    public boolean isReturnSuccess()
    {
        return StringUtils.equalsIgnoreCase(returnCode, SUCCESS);
    }

    public boolean isResultSuccess()
    {
        return StringUtils.equalsIgnoreCase(resultCode, SUCCESS);
    }
}
